ct_check <-
function(data) {
    if (! data.class(data) %in% c('data.frame', 'matrix')) {
        stop('The crosstab needs to a data frame or a matrix.')
    }

    if (nrow(data) != ncol(data)) {
        stop('The crosstab needs to be quadratic.')
    }

    if (! all.equal(rownames(data), colnames(data))) {
        stop('Row and colum names of the crosstab need to match.')
    }

    if (! all(sapply(data, is.character))) {
        stop('All elements of the crosstab need to be character strings.')
    }

    if (! all(is.na(diag(as.matrix(data))))) {
        stop('The crosstab needs to have NAs on its diagonal.')
    }

    message('The crosstab has been validated successfully.')
}
